package com.tracesystem.controller;


import com.tracesystem.commons.Result;
import com.tracesystem.commons.annotation.RuleValidate;
import com.tracesystem.controller.form.UserMenusForm;
import com.tracesystem.controller.info.MenusListInfo;
import com.tracesystem.service.IssueMenusService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Kevin Martin
 * @since 2022-03-23
 */
@RestController
@RequestMapping("/issueMenus")
@Api(tags = "操作菜单")
public class IssueMenusController {
    @Resource
    private IssueMenusService menusService;

    /**
     * 获取树状结构的所有菜单
     *
     * @param userMenusForm
     * @return
     */
    @RuleValidate
    @ApiOperation("获取树状结构的所有菜单")
    @GetMapping("getmenus")
    public Result<List<MenusListInfo>> getmenus(@Validated UserMenusForm userMenusForm) {
        return menusService.getMenus(userMenusForm);
    }


}

